package com.elio.seatademostorage.controller;

import com.elio.seatademostorage.StorageTblService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.bind.annotation.RestController;

/**
 * @ClassName : StorageController
 * @Description : 库存服务
 * @Author : zhaowenyi
 * @Date: 2021/08/13
 */
@RestController
public class StorageController {

    @Autowired
    StorageTblService storageTblService;

    @PostMapping(value = "/api/storage/debuct")
    public void debuct(@RequestParam(value = "commodityCode", required = true) String commodityCode,
                       @RequestParam(value = "count", required = true) Integer count) {
        storageTblService.deduct(commodityCode, count);
    }
}
